package com.asset.dispoal.gbEvidenceIdentification.service.commom;

import com.asset.dispoal.gbEvidenceIdentification.domain.db.entity.GbEvidenceIdentificationDo;
import com.asset.dispoal.gbEvidenceIdentification.domain.db.mapper.GbEvidenceIdentificationMapper;
import com.asset.dispoal.gbEvidenceIdentification.dto.GbEvidenceIdentificationRequest;
import com.asset.dispoal.gbEvidenceIdentification.service.converter.GbEvidenceIdentificationConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.core.ddd.BaseCommand;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/3/3$
 */
@Component
public class UpdateEvidenceIdentificationCommand implements BaseCommand<GbEvidenceIdentificationRequest, Result> {

    @Autowired
    GbEvidenceIdentificationMapper gbEvidenceIdentificationMapper;


    @Override
    public Result execute(GbEvidenceIdentificationRequest request) {
        final GbEvidenceIdentificationDo gbEvidenceIdentificationDo = GbEvidenceIdentificationConverter.INSTANCE.reqToDo(request);
        gbEvidenceIdentificationMapper.update(gbEvidenceIdentificationDo);
        return Result.ok();
    }
}
